$J(document).ready(function(){ 
	GetewayList.init();
}); 

var GetewayList={
		actId :null,
		mapId :null,
		parmData:{},//组装参数
		init:function(){
			this.addLisen();
		},
		//删除网关（网关和室内图关系）
	  removeObj:function() {
		  var o=this;
			$J.ajax({
				type : 'delete',
				url : window.baseUrl + "/pd/getway/del/"+this.actId ,
				dataType : 'json',
				contentType: "application/json",
				async : true,
				cache : false,
				success : function(data) {
					if (data.status == false) {
						if (data.msg)
							$J("#msg").html(data.msg);
						return;
					}
					alert("操作成功！");
					location.reload();
				},
				error : function(data) {
					$J("#msg").html(data.msg);
				}
			});
		},
		//注册事件
		addLisen:function(){
			var o=this;
			$J('body').on('click', 'a[name="remove-content"]', function() {
				o.actId = $J(this).data('content');
			});
			
			$J('body').on('click', '#removeBtn', function() {
				o.removeObj();
			});
		}
}